import { Injectable } from "@angular/core";
import { HttpClient, HttpParams } from "@angular/common/http";
@Injectable({
  providedIn: 'root'
})
export class CustomerFlowingWaterService {
  
  // tableList
  walletUrl = '/userWalletRecord/list';

  // 批量审核
  batchExamineUrl = '/userWalletRecord/examine';
  // 审核开关
  examineSwitchUrl = '/userWalletRecord/totalExamine';

  exportCustomerWaterUrl = '/userWalletRecord/userWalletRecordExcel';

  constructor(public httpClient: HttpClient) { }
  
  // 查询流水table
  queryWalletRecordTbale(params: any) {
    return this.httpClient.post(this.walletUrl, params).toPromise();
  }

  // 批量审核
  batchExamineData(params: any) {
    return this.httpClient.post(this.batchExamineUrl, params).toPromise();
  }

  // 审核开关
  examineSwitchData(params: any) {
    return this.httpClient.post(this.examineSwitchUrl, params).toPromise();
  }

  // 导出Table
  exportCustomerWaterData(params: any) {
    return this.httpClient.get(this.exportCustomerWaterUrl, { params, responseType: 'blob' }).toPromise();
  }
}
